package com.gitee.linzl.zuul.gateway.fiters;

import javax.servlet.http.HttpServletRequest;

import org.springframework.cloud.netflix.zuul.filters.support.FilterConstants;

import com.netflix.zuul.context.RequestContext;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public abstract class AbstractDefaultPreFilter extends AbstractDefaultFilter {

	@Override
	public String filterType() {
		return FilterConstants.PRE_TYPE;
	}

	@Override
	public boolean shouldFilter() {
		return true;
	}

	/**
	 * 忽略部分请求
	 * 
	 * @return
	 */
	private boolean ingoreUrl() {
		RequestContext ctx = RequestContext.getCurrentContext();
		HttpServletRequest request = ctx.getRequest();
		// 在黑名单范围内的，禁止访问
		StringBuffer url = request.getRequestURL();
		log.debug("忽略:{}", url);
		if (url.equals("/favicon.ico")) {
			
		}
		return false;
	}
}
